<p class="location">
  <% if f.object.new_record? %>
    <%= f.text_field :title %>
    <%= link_to_function "Удалить", "this.up('.location').remove()" %>
  <% else %>
    <%= f.object.title %>
    <%= remove_link_unless_new_record(f) %>
  <% end %>
</p>

